package com.derek.omshopping.ui.home.view;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.derek.omshopping.R;
import com.derek.omshopping.config.UrlConfig;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by duyb on 2016-10-20.
 * Desc:viewpage 二级调转页面
 */

public class DetailsPageActivty extends AppCompatActivity {
    @BindView(R.id.global_webview)
    WebView wv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_webview);
        ButterKnife.bind(this);

        wv.getSettings().setJavaScriptEnabled(true);
        wv.setWebChromeClient(new WebChromeClient());
        wv.setWebViewClient(new WebViewClient());
        Intent intent = getIntent();
        if (intent != null) {
            String url = UrlConfig.PRE_BASEURL + intent.getStringExtra("imgId");
            //Log.e("url-->",url);
            wv.loadUrl(url);
        } else {
            Log.e("tag-->", "失败--" + intent.getStringExtra("imgId"));
        }

    }
}
